package com.dcm.live.mapper;

import com.dcm.live.entity.UserFocusEntity;
import com.dcm.live.entity.UserFocusEntity;
import com.dcm.live.entity.UserLikeEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * [点赞]
 *
 * @author : [pengrongsheng]
 * @createTime : [2021/4/8]
 */
public interface FocusMapper {

    /**
     * 保存点赞记录
     *
     * @param userFocusEntity
     * @return
     */
    void insert(UserFocusEntity userFocusEntity);

    /**
     * 修改关注记录
     *
     * @param userFocusEntity
     * @return
     */
    void update(UserFocusEntity userFocusEntity);

    /**
     * 即查询都谁给这个人点过关注（查粉丝）
     *
     * @param focusUserId 主播id
     * @return
     */
    List<UserFocusEntity> getListByFocusUserId(Long focusUserId);

    /**
     * 即查询这个人都给谁点关注过
     *
     * @param focusPostId 观众id
     * @return
     */
    List<UserFocusEntity> getListByFocusPostId(Long focusPostId);

    /**
     * 根据 id 查找数据
     * @param focusUserId uid 主播id
     * @param focusPostId id 观众id
     * @return
     */
    UserFocusEntity findByUidAndId(@Param("focusUserId") Long focusUserId,
                                   @Param("focusPostId") Long focusPostId);


}
